package com.gym.code.generator.model.mapping.layer.dao;

import org.apache.commons.lang.StringUtils;

import com.gym.code.generator.model.mapping.layer.LayerGenerateModel;
import com.gym.code.generator.utils.LocalStringUtils;

/**
 * 
 * @author xinchun.wang
 * @email: 532002108@qq.com
 * @createTime 2015-4-11 下午1:39:49
 */
public class DaoLayerGenerateModel extends LayerGenerateModel {
	private String jdbcTemplateName;
	private String daoName;
	private String tableName;
	private String daoFaceName;

	public String getJdbcTemplateName() {
		return jdbcTemplateName;
	}

	public void setJdbcTemplateName(String jdbcTemplateName) {
		this.jdbcTemplateName = jdbcTemplateName;
	}

	public String getDaoName() {
		return daoName;
	}

	public void setDaoName(String daoName) {
		this.daoName = daoName;
	}

	@Override
	protected String getFileName() {
		return LocalStringUtils.toFirstLetterUpper(daoName);
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getDaoFaceName() {
		if(StringUtils.isEmpty(daoFaceName)){
			daoFaceName = "I" + daoName ;
		}
		return daoFaceName;
	}

	public void setDaoFaceName(String daoFaceName) {
		this.daoFaceName = daoFaceName;
	}

	@Override
	public String getPackageName() {
		return packagePath  + ".dao.impl";
	}

}
